import { Module } from '@nestjs/common'
import { ConfigModule, ConfigService } from '@nestjs/config'
import { MongooseModule } from '@nestjs/mongoose'
import { PassportModule } from '@nestjs/passport'
import { WechatConfig } from '../config/wechat.config'
import { AuthController } from '../controllers/auth.controller'
import { UserSchema } from '../models/User'
import { AuthService } from '../services/auth/AuthService'

@Module({
  imports: [
    ConfigModule.forRoot(),
    PassportModule.register({ defaultStrategy: 'wechat' }),
    MongooseModule.forFeature([{ name: 'User', schema: UserSchema }]),
  ],
  providers: [AuthService, WechatConfig, ConfigService],
  controllers: [AuthController],
})
export class AuthModule {}
